<?
/* @author Udo Schroeter <udo.schroeter@gmail.com>
 * @license dual license: LGPL / commercial use license
 */ 
?><style>
.sq_hidden {
  background: url(img/icons/bgmap100.png) #c0c0c0;
}
._sq_foggy1 {
  -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"
  filter: alpha(opacity=40); 
  opacity: .4;
  background: #e0d0d0;
}
._sq_foggy2 {
  -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"
  filter: alpha(opacity=70); 
  opacity: .70;
  background: #c0c0c0;
}
.sq_foggy1 {
  background: url(img/icons/bgmap50.png);
}
.sq_foggy2 {
  background: url(img/icons/bgmap75.png);
}
.sq_position {
  background: url(img/icons/greenled50.png);
}
.sq_visible {

}
</style><!--<img src="img/maps/<?= $this->zoneStats['map'] ?>.png" 
  style="position: absolute; top: 121px; 
    border: 1px solid #a0a0a0;" width="550"/> -->
<table style="background: url(img/maps/<?= $this->zoneStats['map'] ?>.png);" width="552" cellpadding="0" cellspacing="0">
<?
$rowCount=8;
$colCount=10;
$rowHeight=51;

for($r = 0; $r < $rowCount; $r++)
{
  ?><tr><?
  for($c = 0; $c < $colCount; $c++)
  {
    ?><td>
      <div style="height: <?= $rowHeight ?>px; border-right: 1px solid #a0a0a0; 
        border-bottom: 1px solid #a0a0a0;" class="<?
        if ($this->mstats['xpos'] == $c && $this->mstats['ypos'] == $r)
          print('sq_position');
        else if (($this->mstats['xpos'] == $c-1 && $this->mstats['ypos'] == $r)
          || ($this->mstats['xpos'] == $c && $this->mstats['ypos'] == $r-1)
          || ($this->mstats['xpos'] == $c+1 && $this->mstats['ypos'] == $r)
          || ($this->mstats['xpos'] == $c && $this->mstats['ypos'] == $r+1)
          )
          print('sq_visible');
        else if ($this->mstats['explored.'.$c.'.'.$r] 
          || $this->mstats['explored.'.($c-1).'.'.($r)]
          || $this->mstats['explored.'.($c).'.'.($r-1)]
          || $this->mstats['explored.'.($c-1).'.'.($r-1)]
          || $this->mstats['explored.'.($c+1).'.'.($r)]
          || $this->mstats['explored.'.($c).'.'.($r+1)]
          || $this->mstats['explored.'.($c+1).'.'.($r+1)]
          || $this->mstats['explored.'.($c-1).'.'.($r+1)]
          || $this->mstats['explored.'.($c-1).'.'.($r-1)]
          || $this->mstats['explored.'.($c+1).'.'.($r-1)]
          )
          print('sq_foggy1');
        else if ($this->mstats['explored.'.($c).'.'.($r-2)]
          || $this->mstats['explored.'.($c).'.'.($r+2)]
          || $this->mstats['explored.'.($c-2).'.'.($r)]
          || $this->mstats['explored.'.($c+2).'.'.($r)]
          )
          print('sq_foggy2');
        else
          print('sq_hidden');
        ?>">
      
      </div>
    </td><?
  }
  ?></tr><?
}
$baselink = actionUrl('index', 'game', 'move=');
?>
</table>
<table align="center">
<tr>
  <td colspan="20"><div align="center" style="font-weight: bold;">
    <a href="<?= $baselink ?>w">&lt; move west</a> |
    <a href="<?= $baselink ?>n">move north</a> |
    <a href="<?= $baselink ?>s">move south</a> |
    <a href="<?= $baselink ?>e">move east</a> &gt;
  </div><?
  if ($this->user->localRecord['u_type'] == 'gm')
  {
    ?><div align="center"><?
    print($this->mstats['xpos'].':'.$this->mstats['ypos'].' - locations: ');
    print($this->mstats['loclist']);
    ?></div><?
  }  
  ?></td>
</tr>
</table>